﻿@model PagedList<LateFee>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="/css/style.css" rel="stylesheet" type="text/css" />
    <link href="/css/select.css" rel="stylesheet" type="text/css" />
    <link href="/css/basicinfostyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/js/jquery.js"></script>
    <script src="/js/jquery.form.js"></script>
    <script type="text/javascript" src="/js/jquery.idTabs.min.js"></script>
    <script type="text/javascript" src="/js/select-ui.min.js"></script>
    <script language="javascript">
        $(function () {
            //导航切换
            $(".imglist li").click(function () {
                $(".imglist li.selected").removeClass("selected")
                $(this).addClass("selected");
            })
        })
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            var api = {
                edit: "/commonset/LatefeeEdit",
                del: "/commonset/LatefeeDel"
            }
            $('#form1').attr('action', api.edit);
            $('#form2').attr('action', api.edit);

            //抄表添加
            $(".clickreaderfromadd").click(function () {
                $(".tipreaderfromadd").fadeIn(200);
            });

            $(".tiptopreaderfromadd a").click(function () {
                $(".tipreaderfromadd").fadeOut(200);
            });

            $(".surereaderfromadd").click(function () {
                $('#form1').ajaxSubmit({
                    success: function (data) {
                        if (data.Succeed) {
                            window.location.reload();
                        } else {
                            alert(data.Msg);
                        }
                    }
                })



            });

            $(".cancelreaderfromadd").click(function () {
                $(".tipreaderfromadd").fadeOut(100);
            });


            //抄表修改
            $(".clickfromchangemodify").click(function () {
                var count = $("input:checked").length;
                if (count < 1) {
                    alert("至少选择一项进行修改！");
                }
                else if (count > 1) {
                    alert("只能选择一项进行修改！");
                }
                else {
                    $(".tipfromchangemodify").fadeIn(200);
                    $obj = $("input:checked").parents("tr");
                    $('#form2').find("input[name='Id']").val($obj.attr("Id"));
                    
                    if ($obj.attr("WaterTypeId")) {
                        $('#form2').find("select[name='WaterTypeId']").find("option[value='" + $obj.attr("WaterTypeId") + "']").attr("selected", true);
                        $('#form2').find("select[name='WaterTypeId']").prev().find("em:first").text($('#form2').find("select[name='WaterTypeId']").find("option:selected").text());
                    }

                    $('#form2').find("select[name='GetState']").find("option[value='" + $obj.attr("GetState") + "']").attr("selected", true);
                    $('#form2').find("select[name='GetState']").prev().find("em:first").text($('#form2').find("select[name='GetState']").find("option:selected").text());

                    

                    $('#form2').find("select[name='ChargeType']").find("option[value='" + $obj.attr("ChargeType") + "']").attr("selected", true);
                    $('#form2').find("select[name='ChargeType']").prev().find("em:first").text($('#form2').find("select[name='ChargeType']").find("option:selected").text());

                    
                    $('#form2').find("input[name='LevelStand']").val($obj.attr("LevelStand"));
                    $('#form2').find("input[name='TaxRate']").val($obj.attr("TaxRate"));

                    
                    $('#form2').find("select[name='StartDayOnMonth']").find("option[value='" + $obj.attr("StartDayOnMonth") + "']").attr("selected", true);
                    $('#form2').find("select[name='StartDayOnMonth']").prev().find("em:first").text($('#form2').find("select[name='StartDayOnMonth']").find("option:selected").text());

                    

                    $('#form2').find("select[name='EffectiveDate']").find("option[value='" + $obj.attr("EffectiveDate") + "']").attr("selected", true);
                    $('#form2').find("select[name='EffectiveDate']").prev().find("em:first").text($('#form2').find("select[name='EffectiveDate']").find("option:selected").text());

                    
                    $('#form2').find("input[name='StartDay']").val($obj.attr("StartDay"));
                    $('#form2').find("input[name='EndDay']").val($obj.attr("EndDay")); 
                     
                }
            });

            $(".tiptopfromchangemodify a").click(function () {
                $(".tipfromchangemodify").fadeOut(200);
            });

            $(".surefromchangemodify").click(function () {

                $('#form2').ajaxSubmit({
                    success: function (data) {
                        if (data.Succeed) {
                            window.location.reload();
                        } else {
                            alert(data.Msg);
                        }
                    }
                })


            });

            $(".cancelfromchangemodify").click(function () {
                $(".tipfromchangemodify").fadeOut(100);
            });


            //删除用户
            $(".clickdel").click(function (del) {
                var count = $("input:checked").length;
                if (count < 1) {
                    alert("至少选择一项进行删除！");
                }
                else if (count > 1) {
                    alert("只能选择一项进行修改！");
                }
                else {
                    $(".tipdel").fadeIn(200);
                }
            });

            $(".tiptopdel a").click(function (del) {
                $(".tipdel").fadeOut(200);
            });

            $(".suredel").click(function (del) {
                $obj = $("input:checked").parents("tr");
                $.post(api.del, { id: $obj.attr("Id") }, function (data) {
                    $(".tipdel").fadeOut(100);
                    window.location.reload();
                }, 'json')
            });

            $(".canceldel").click(function (del) {
                $(".tipdel").fadeOut(100);
            });

        });

    </script>
    <script type="text/javascript">
        $(document).ready(function (e) {
            $(".select1").uedSelect({
                width: 345
            });
            $(".select2").uedSelect({
                width: 167
            });
            $(".select3").uedSelect({
                width: 150
            });
        });
    </script>
</head>
<body>
    <div class="place">
        <span>位置：</span>
        <ul class="placeul">
            <li><a href="#">首页</a></li>
            <li><a href="#">基本设置管理</a></li>
            <li><a href="#">滞纳金设置</a></li>
        </ul>
    </div>
    <div class="rightinfo">
        <div class="tools">
            <ul class="toolbar">
                <li class="clickreaderfromadd"><span><img src="/images/t01a.png" /></span>添加</li>
                <li class="clickfromchangemodify"><span><img src="/images/t02.png" /></span>修改</li>
                <li class="clickdel"><span><img src="/images/t03.png" /></span>删除</li>

            </ul>

        </div>
        <table class="imgtable">
            <thead>
                <tr>
                    <th>选择</th>
                    <th>用水类型</th>
                    <th>计费方式</th>
                    <th>最低标准</th>
                    <th>利率(‰)</th>
                    <th>开始日期</th>
                    <th>生效日期</th>
                    <th>滞纳天数区间</th>
                    <th>收取状态</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                { 
                    <tr GetState="@(item.GetState?"true":"false")" EndDay="@item.EndDay" StartDay="@item.StartDay" id="@item.Id" WaterTypeId="@(item.WaterTypeId)" ChargeType="@item.ChargeType" LevelStand="@item.LevelStand" TaxRate="@(item.TaxRate)" StartDayOnMonth="@(item.StartDayOnMonth)"  EffectiveDate="@item.EffectiveDate.ToString("yyyy/MM/dd")" >
                        <td><input name="" type="checkbox" value="@(item.Id)" /></td>
                        <td>@(item.WaterType?.TypeName)</td>
                        <td height="30px;">@(((LateFee.ChargeTypeEnum)item.ChargeType).ToDescription())</td>
                        <td><a href="#">@(item.LevelStand)</a></td>
                        <td>@(item.TaxRate)</td>
                        <td>@(item.StartDayOnMonth)号/每月</td>
                        <td>@(item.EffectiveDate.ToString("yyyy年MM月dd日"))</td>
                        <td>@(item.StartDay)-@(item.EndDay)</td>
                        <td>@(item.GetState ? "开启" : "关闭")</td>
                    </tr>

                }

            </tbody>
        </table>
        <div class="pagin">
            <div class="message">共<i class="blue">@(Model.TotalItemCount)</i>条记录，共&nbsp;<i class="blue">@(Model.TotalPageCount)&nbsp;</i>页</div>
            @Html.Pager(Model, BaseController.PagerOptions)
        </div>
        <form id="form1" method="post">
            <!--滞纳金设置-->
            <div class="tipreaderfromadd">
                <div class="tiptopreaderfromadd"><img src="/images/t06.png" /><span>滞纳金设置</span><a></a></div>
                <div class="tipinforeaderfromadd">
                    <div class="userinfozbreaderfromadd">
                        <dt class="userinfozbtitreaderfromadd">滞纳金设置信息</dt>
                        <ul class="seachform">
                            @Html.Action("_WaterType", "Common", "addsellssss")

                            <li>
                                <label>收取状态</label>
                                <div class="vocation">
                                    <select class="select3" name="GetState">
                                        <option value="true">开启</option>
                                        <option value="false">关闭</option>
                                    </select>
                                </div>
                            </li>

                            <li>
                                <label>计费方式</label>
                                <div class="vocation">
                                    <select class="select3" name="ChargeType">
                                        <option value="0">按固定金额</option>
                                        <option value="1">按利率</option>
                                    </select>
                                </div>
                            </li>

                            <li>
                                <label>最低标准</label>
                                <input name="LevelStand" type="text" class="scinput" />
                            </li>

                            <li>
                                <label>税率设置</label>
                                <input name="TaxRate" type="text" class="scinput" />
                            </li>

                            <li>
                                <label>开启日期</label>
                                <div class="vocation">
                                    <select class="select3" name="StartDayOnMonth">
                                        <option value="1">1号/月</option>
                                        <option value="2">2号/月</option>
                                        <option value="3">3号/月</option>
                                        <option value="4">4号/月</option>
                                    </select>
                                </div>
                            </li>
                            <li>
                                <label>生效日期</label>
                                <div class="vocation">
                                    <select class="select3" name="EffectiveDate">
                                        @{ var date = DateTime.Now;}
                                        @while (date < DateTime.Now.AddMonths(1))
                                        {
                                            <option value="@(date.ToString("yyyy/MM/dd"))">@(date.ToString("yyyy年MM月dd日"))</option>
                                            date = date.AddDays(1);
                                        }
                                    </select>
                                </div>
                            </li>
                            <li>
                                <label>起始天数</label>
                                <input name="StartDay" type="text" class="scinput" />
                            </li>
                            <li>
                                <label>为止天数</label>
                                <input name="EndDay" type="text" class="scinput" />
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="tipbtnreaderfromadd">
                    <input name="" type="button" class="surereaderfromadd" value="添加" />
                    &nbsp;
                    <input name="" type="button" class="cancelreaderfromadd" value="取消" />
                </div>
            </div>
        </form>


        <!--删除用户-->
        <div class="tipdel">
            <div class="tiptopdel"><span>提示信息</span><a></a></div>
            <div class="tipinfodel">
                <span><img src="/images/ticon01.png" /></span>
                <div class="tiprightdel">
                    <p>确定要删除选中的滞纳金吗？</p>
                    <cite>如果是请点击确定按钮，否则请点取消。</cite>
                </div>
            </div>
            <div class="tipbtndel">
                <input name="" type="button" class="suredel" value="确定" />
                &nbsp;
                <input name="" type="button" class="canceldel" value="取消" />
            </div>
        </div>

        <form id="form2" method="post">
            <!--滞纳金修改-->
            <div class="tipfromchangemodify">
                <div class="tiptopfromchangemodify"><img src="/images/t06.png" /><span>滞纳金修改</span><a></a></div>
                <div class="tipinfofromchangemodify">
                    <div class="userinfozbfromchangemodify">
                        <dt class="userinfozbtitfromchangemodify">滞纳金信息</dt>
                        <ul class="seachform">
                            @Html.Action("_WaterType", "Common", "addsellssss232233232")

                            <li>
                                <label>收取状态</label>
                                <div class="vocation">
                                    <select class="select3" name="GetState">
                                        <option value="true">开启</option>
                                        <option value="false">关闭</option>
                                    </select>
                                </div>
                            </li>

                            <li>
                                <label>计费方式</label>
                                <div class="vocation">
                                    <select class="select3" name="ChargeType">
                                        <option value="0">按固定金额</option>
                                        <option value="1">按利率</option>
                                    </select>
                                </div>
                            </li>

                            <li>
                                <label>最低标准</label>
                                <input name="LevelStand" type="text" class="scinput" />
                            </li>

                            <li>
                                <label>税率设置</label>
                                <input name="TaxRate" type="text" class="scinput" />
                            </li>

                            <li>
                                <label>开启日期</label>
                                <div class="vocation">
                                    <select class="select3" name="StartDayOnMonth">
                                        <option value="1">1号/月</option>
                                        <option value="2">2号/月</option>
                                        <option value="3">3号/月</option>
                                        <option value="4">4号/月</option>
                                    </select>
                                </div>
                            </li>
                            <li>
                                <label>生效日期</label>
                                <div class="vocation">
                                    <select class="select3" name="EffectiveDate">
                                        @{ var date1 = DateTime.Now;}
                                        @while (date1 < DateTime.Now.AddMonths(1))
                                        {
                                            <option value="@(date1.ToString("yyyy/MM/dd"))">@(date1.ToString("yyyy年MM月dd日"))</option>
                                            date1 = date.AddDays(1);
                                        }
                                    </select>
                                </div>
                            </li>
                            <li>
                                <label>起始天数</label>
                                <input name="StartDay" type="text" class="scinput" />
                            </li>
                            <li>
                                <label>为止天数</label>
                                <input name="EndDay" type="text" class="scinput" />
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="tipbtnfromchangemodify">
                    @Html.Hidden("Id","")
                    <input name="" type="button" class="surefromchangemodify" value="确定" />
                    &nbsp;
                    <input name="" type="button" class="cancelfromchangemodify" value="取消" />
                </div>
            </div>

        </form>
        <script type="text/javascript">
            $('.tablelist tbody tr:odd').addClass('odd');
        </script>
    </div>
</body>
</html>
